# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=Try-Tiny
pkgname=perl-${_realname}
pkgver=0.22
pkgrel=2
pkgdesc="Minimal try/catch with proper localization of \$@"
arch=('any')
url="http://search.cpan.org/dist/Try-Tiny"
groups=('perl-modules')
license=('MIT')
depends=('perl')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/D/DO/DOY/${_realname}-${pkgver}.tar.gz")
sha1sums=('3b4f180a97ac0b3fb5b6b54b0f7adeb33e193a34')

build() {
  cd ${_realname}-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_realname}-${pkgver}
  make test
}

package() {
  cd ${_realname}-${pkgver}
  make DESTDIR="$pkgdir" install
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
